//
//  PaperAssessmentTitleView.m
//  ZYOnlineSchool
//
//  Created by 毕武侠 on 2017/1/12.
//  Copyright © 2017年 bwx. All rights reserved.
//

#import "PaperAssessmentTitleView.h"

@interface PaperAssessmentTitleView ()

@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation PaperAssessmentTitleView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self createView];
    }
    return self;
}

- (void)createView {
    UIView *lineView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 1)];
    lineView1.backgroundColor = RGB(234, 234, 234);
    [self addSubview:lineView1];
    
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(12.0, 0, 2, 18)];
    lineView.centerY = self.height / 2;
    lineView.backgroundColor = MainThemeColor;
    [self addSubview:lineView];
    
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.left = lineView.right + 10.0f;
    self.titleLabel.height = self.height;
    self.titleLabel.width = self.width - 30.0f;
    self.titleLabel.font = [UIFont systemFontOfSize:18.0f];
    [self addSubview:self.titleLabel];
    
    UIView *lineView2 = [[UIView alloc] initWithFrame:CGRectMake(0, self.height -1, SCREEN_WIDTH, 1)];
    lineView2.backgroundColor = RGB(234, 234, 234);
    [self addSubview:lineView2];
}

- (void)setText:(NSString *)text {
    _text = text;
    self.titleLabel.text = text;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
